﻿<phone:PhoneApplicationPage
    x:Class="掌控校园.CoursePageSettings"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:掌控校园="clr-namespace:掌控校园"
    d:DataContext="{d:DesignData SampleData/BackgroundList.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True"
    shell:SystemTray.Opacity="0"
    shell:SystemTray.ForegroundColor="#FF00AFF0"
    >
    
    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>
    
    <phone:PhoneApplicationPage.Resources>
        <掌控校园:PathToImage x:Key="StringToImage"/>
        <DataTemplate x:Key="BackgoundImageDataTemplate">
            <Grid>
                <Border BorderThickness="1" BorderBrush="Tomato"></Border>
                <Image Margin="1,1,11,1" Source="{Binding FilePath, Converter={StaticResource StringToImage}}"></Image>
            </Grid>

        </DataTemplate>

    </phone:PhoneApplicationPage.Resources>
    
    
    
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel 包含应用程序的名称和页标题-->
        <StackPanel Grid.Row="0" Margin="12,17,0,10">
            <TextBlock Text="掌控校园" Foreground="#FF00AFF0" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock Text="设置" Foreground="#FF00AFF0" Margin="9,-7,0,0" Style="{StaticResource PhoneTextLargeStyle}"/>
        </StackPanel>
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <ScrollViewer Margin="0,0,12,0">
                <StackPanel>
                    <TextBlock Text="开启推送" Style="{StaticResource PhoneTextNormalStyle}" Foreground="#FF00AFF0" FontSize="30"/>
                    <toolkit:ToggleSwitch x:Name="PushToggleSwitch" 
                                          IsChecked="True"
                                          SwitchForeground="#FF00AFF0" 
                                          Foreground="#FF00AFF0"
                                          Margin="0,-20,0,-10"
                                          Checked="Push_Checked" 
                                          Unchecked="Push_UnChecked"
                                          />

                    <TextBlock Text="动态磁贴" Style="{StaticResource PhoneTextNormalStyle}" Foreground="#FF00AFF0" FontSize="30"/>
                    <toolkit:ToggleSwitch x:Name="TileToggleSwitch" 
                                          IsChecked="True"
                                          SwitchForeground="#FF00AFF0" 
                                          Foreground="#FF00AFF0"
                                          Margin="0,-20,0,-10"
                                          Checked="DynamicTile_Checked"
                                          Unchecked="DynamicTile_UnChecked"
                                          />
                    <TextBlock Text="自动更换颜色" Style="{StaticResource PhoneTextNormalStyle}" Foreground="#FF00AFF0" FontSize="30"/>
                    <toolkit:ToggleSwitch x:Name="ChangeColorToggleSwitch" 
                                          IsChecked="True"
                                          SwitchForeground="#FF00AFF0" 
                                          Foreground="#FF00AFF0"
                                          Margin="0,-20,0,-10"
                                          Checked="ChangeColor_Checked"
                                          Unchecked="ChangeColor_UnChecked"
                                          />
                    <TextBlock Text="自动更换背景" Style="{StaticResource PhoneTextNormalStyle}" Foreground="#FF00AFF0" FontSize="30"/>
                    <toolkit:ToggleSwitch x:Name="ChangeBackgroundoggleSwitch" 
                                          IsChecked="True"
                                          SwitchForeground="#FF00AFF0" 
                                          Foreground="#FF00AFF0"
                                          Margin="0,-20,0,-10"
                                          Checked="ChangeBackground_Checked"
                                          Unchecked="ChangeBackground_UnChecked"
                                          />

                    <phone:LongListSelector x:Name="BackgroundLongListSelector"
                                            ItemTemplate="{StaticResource BackgoundImageDataTemplate}"
                                            ItemsSource="{Binding ImageList}"
                                            GridCellSize="140,270"
                                            LayoutMode="Grid"
                                            Margin="12,0,0,0"
                                            SelectionChanged="ChangeBackgroundUri_SelectionChangd"
                                            />
                    
                </StackPanel>
                
            </ScrollViewer>
            
            
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>